package practise.fina;

/**
 * Created with IntelliJ IDEA.
 * User: xinlyu
 * Date: 7/2/12
 * Time: 2:10 PM
 * To change this template use File | Settings | File Templates.
 */
public class StaticDispatch {
    static abstract class Human{

    }

    static class Man extends Human{

    }

    static class Woman extends Human{

    }

    public void dispatch(Human man){
        System.out.println("hello , guy");
    }
    public void dispatch(Man man){
        System.out.println("hello , man");
    }

    public void dispatch(Woman woman){
        System.out.println("hello , girl");
    }

    public static  void main(String[] args){
        Human man   = new Man();
        Human woman = new Woman();
        StaticDispatch staticDispatch = new StaticDispatch();
        staticDispatch.dispatch(man);
        staticDispatch.dispatch(woman);
    }
}
